from qttab.pd import get_query_df, get_df_from_db
from qttab.sqlite_db import update_one_row, find_many, insert_rows, insert_one_row, insert_by_dict

model_tb_name = "idrs"


def update_status_url_to_idrs(status, url, idrs_id):
    update_one_row(model_tb_name, ["status", "url", "id"], [status, url, idrs_id])


def update_status_to_idrs(status, idrs_id):
    update_one_row(model_tb_name, ["status", "id"], [status, idrs_id])


def insert_one_idrs(col_list, value):
    return insert_one_row(model_tb_name, col_list, value)


def insert_idrs_by_dict(idrs_dict: dict):
    return insert_by_dict(model_tb_name, idrs_dict)


def insert_many_idrs(col_list, values):
    return insert_rows(model_tb_name, col_list, values)


def find_idrs_df(condition):
    return get_df_from_db(model_tb_name, condition)


def find_idrs_db(condition):
    return find_many(model_tb_name, condition)
